home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / gunsmoke.c < prev    next >
C/C++ Source or Header  |  2000-04-04  |  21KB  |  497 lines

  1. /***************************************************************************
  2.  
  3.   GUNSMOKE
  4.   ========
  5.  
  6.   Driver provided by Paul Leaman
  7.  
  8. ***************************************************************************/
  9.  
  10. #include "driver.h"
  11. #include "vidhrdw/generic.h"
  12.  
  13.  
  14.  
  15. READ_HANDLER( gunsmoke_bankedrom_r );
  16. extern void gunsmoke_init_machine(void);
  17.  
  18. extern unsigned char *gunsmoke_bg_scrollx;
  19. extern unsigned char *gunsmoke_bg_scrolly;
  20.  
  21. WRITE_HANDLER( gunsmoke_c804_w );    /* in vidhrdw/c1943.c */
  22. WRITE_HANDLER( gunsmoke_d806_w );    /* in vidhrdw/c1943.c */
  23. void gunsmoke_vh_convert_color_prom(unsigned char *palette, unsigned short *colortable,const unsigned char *color_prom);
  24. void gunsmoke_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  25. int gunsmoke_vh_start(void);
  26. void gunsmoke_vh_stop(void);
  27.  
  28.  
  29.  
  30. static READ_HANDLER( gunsmoke_unknown_r )
  31. {
  32.     static int gunsmoke_fixed_data[]={ 0xff, 0x00, 0x00 };
  33.     /*
  34.     The routine at 0x0e69 tries to read data starting at 0xc4c9.
  35.     If this value is zero, it interprets the next two bytes as a
  36.     jump address.
  37.  
  38.     This was resulting in a reboot which happens at the end of level 3
  39.     if you go too far to the right of the screen when fighting the level boss.
  40.  
  41.     A non-zero for the first byte seems to be harmless  (although it may not be
  42.     the correct behaviour).
  43.  
  44.     This could be some devious protection or it could be a bug in the
  45.     arcade game.  It's hard to tell without pulling the code apart.
  46.     */
  47.     return gunsmoke_fixed_data[offset];
  48. }
  49.  
  50.  
  51.  
  52. static struct MemoryReadAddress readmem[] =
  53. {
  54.     { 0x0000, 0x7fff, MRA_ROM },
  55.     { 0x8000, 0xbfff, MRA_BANK1 },
  56.     { 0xc000, 0xc000, input_port_0_r },
  57.     { 0xc001, 0xc001, input_port_1_r },
  58.     { 0xc002, 0xc002, input_port_2_r },
  59.     { 0xc003, 0xc003, input_port_3_r },
  60.     { 0xc004, 0xc004, input_port_4_r },
  61.     { 0xc4c9, 0xc4cb, gunsmoke_unknown_r },
  62.     { 0xd000, 0xd3ff, videoram_r },
  63.     { 0xd400, 0xd7ff, colorram_r },
  64.     { 0xe000, 0xffff, MRA_RAM }, /* Work + sprite RAM */
  65.     { -1 }    /* end of table */
  66. };
  67.  
  68. static struct MemoryWriteAddress writemem[] =
  69. {
  70.     { 0x0000, 0xbfff, MWA_ROM },
  71.     { 0xc800, 0xc800, soundlatch_w },
  72.     { 0xc804, 0xc804, gunsmoke_c804_w },    /* ROM bank switch, screen flip */
  73.     { 0xc806, 0xc806, MWA_NOP }, /* Watchdog ?? */
  74.     { 0xd000, 0xd3ff, videoram_w, &videoram, &videoram_size },
  75.     { 0xd400, 0xd7ff, colorram_w, &colorram },
  76.     { 0xd800, 0xd801, MWA_RAM, &gunsmoke_bg_scrolly },
  77.     { 0xd802, 0xd802, MWA_RAM, &gunsmoke_bg_scrollx },
  78.     { 0xd806, 0xd806, gunsmoke_d806_w },    /* sprites and bg enable */
  79.     { 0xe000, 0xefff, MWA_RAM },
  80.     { 0xf000, 0xffff, MWA_RAM, &spriteram, &spriteram_size },
  81.     { -1 }    /* end of table */
  82. };
  83.  
  84.  
  85.  
  86. static struct MemoryReadAddress sound_readmem[] =
  87. {
  88.     { 0x0000, 0x7fff, MRA_ROM },
  89.     { 0xc000, 0xc7ff, MRA_RAM },
  90.     { 0xc800, 0xc800, soundlatch_r },
  91.     { -1 }    /* end of table */
  92. };
  93.  
  94. static struct MemoryWriteAddress sound_writemem[] =
  95. {
  96.     { 0x0000, 0x7fff, MWA_ROM },
  97.     { 0xc000, 0xdfff, MWA_RAM },
  98.     { 0xe000, 0xe000, YM2203_control_port_0_w },
  99.     { 0xe001, 0xe001, YM2203_write_port_0_w },
  100.     { 0xe002, 0xe002, YM2203_control_port_1_w },
  101.     { 0xe003, 0xe003, YM2203_write_port_1_w },
  102.     { -1 }    /* end of table */
  103. };
  104.  
  105.  
  106.  
  107. INPUT_PORTS_START( gunsmoke )
  108.     PORT_START    /* IN0 */
  109.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
  110.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
  111.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )    /* probably unused */
  112.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )    /* probably unused */
  113.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN3 )
  114.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )    /* probably unused */
  115.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
  116.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
  117.  
  118.     PORT_START    /* IN1 */
  119.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  120.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY )
  121.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY )
  122.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY )
  123.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
  124.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
  125.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 )
  126.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )    /* probably unused */
  127.  
  128.     PORT_START    /* IN2 */
  129.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  130.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY | IPF_COCKTAIL )
  131.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY | IPF_COCKTAIL )
  132.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY | IPF_COCKTAIL )
  133.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  134.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_COCKTAIL )
  135.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_COCKTAIL )
  136.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )    /* probably unused */
  137.  
  138.     PORT_START    /* DSW0 */
  139.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Bonus_Life ) )
  140.     PORT_DIPSETTING(    0x03, "30k, 100k & every 100k")
  141.     PORT_DIPSETTING(    0x02, "30k, 80k & every 80k" )
  142.     PORT_DIPSETTING(    0x01, "30k & 100K only")
  143.     PORT_DIPSETTING(    0x00, "30k, 100k & every 150k" )
  144.     PORT_DIPNAME( 0x04, 0x04, "Demonstration" )
  145.     PORT_DIPSETTING(    0x00, DEF_STR( Off ))
  146.     PORT_DIPSETTING(    0x04, DEF_STR( On ) )
  147.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
  148.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ))
  149.     PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ))
  150.     PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) )
  151.     PORT_DIPSETTING(    0x20, "Easy" )
  152.     PORT_DIPSETTING(    0x30, "Normal" )
  153.     PORT_DIPSETTING(    0x10, "Difficult" )
  154.     PORT_DIPSETTING(    0x00, "Very Difficult" )
  155.     PORT_DIPNAME( 0x40, 0x40, "Freeze" )
  156.     PORT_DIPSETTING(    0x40, DEF_STR( Off ))
  157.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  158.     PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
  159.  
  160.     PORT_START      /* DSW1 */
  161.     PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_B ) )
  162.     PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ))
  163.     PORT_DIPSETTING(    0x01, DEF_STR( 3C_1C ) )
  164.     PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
  165.     PORT_DIPSETTING(    0x07, DEF_STR( 1C_1C ) )
  166.     PORT_DIPSETTING(    0x06, DEF_STR( 1C_2C ) )
  167.     PORT_DIPSETTING(    0x05, DEF_STR( 1C_3C ) )
  168.     PORT_DIPSETTING(    0x04, DEF_STR( 1C_4C ) )
  169.     PORT_DIPSETTING(    0x03, DEF_STR( 1C_6C ) )
  170.     PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coin_A ) )
  171.     PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ))
  172.     PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C ) )
  173.     PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
  174.     PORT_DIPSETTING(    0x38, DEF_STR( 1C_1C ) )
  175.     PORT_DIPSETTING(    0x30, DEF_STR( 1C_2C ) )
  176.     PORT_DIPSETTING(    0x28, DEF_STR( 1C_3C ) )
  177.     PORT_DIPSETTING(    0x20, DEF_STR( 1C_4C ) )
  178.     PORT_DIPSETTING(    0x18, DEF_STR( 1C_6C ) )
  179.     PORT_DIPNAME( 0x40, 0x40, "Allow Continue" )
  180.     PORT_DIPSETTING(    0x00, DEF_STR( No ))
  181.     PORT_DIPSETTING(    0x40, DEF_STR( Yes ))
  182.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) )
  183.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  184.     PORT_DIPSETTING(    0x80, DEF_STR( On ))
  185. INPUT_PORTS_END
  186.  
  187. static struct GfxLayout charlayout =
  188. {
  189.     8,8,    /* 8*8 characters */
  190.     1024,    /* 1024 characters */
  191.     2,    /* 2 bits per pixel */
  192.     { 4, 0 },
  193.     { 0, 1, 2, 3, 8+0, 8+1, 8+2, 8+3 },
  194.     { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 },
  195.     16*8    /* every char takes 16 consecutive bytes */
  196. };
  197. static struct GfxLayout spritelayout =
  198. {
  199.     16,16,    /* 16*16 sprites */
  200.     2048,    /* 2048 sprites */
  201.     4,      /* 4 bits per pixel */
  202.     { 2048*64*8+4, 2048*64*8+0, 4, 0 },
  203.     { 0, 1, 2, 3, 8+0, 8+1, 8+2, 8+3,
  204.             32*8+0, 32*8+1, 32*8+2, 32*8+3, 33*8+0, 33*8+1, 33*8+2, 33*8+3 },
  205.     { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16,
  206.             8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16 },
  207.     64*8    /* every sprite takes 64 consecutive bytes */
  208. };
  209.  
  210. static struct GfxLayout tilelayout =
  211. {
  212.     32,32,  /* 32*32 tiles */
  213.     512,    /* 512 tiles */
  214.     4,      /* 4 bits per pixel */
  215.     { 512*256*8+4, 512*256*8+0, 4, 0 },
  216.     { 0, 1, 2, 3, 8+0, 8+1, 8+2, 8+3,
  217.             64*8+0, 64*8+1, 64*8+2, 64*8+3, 65*8+0, 65*8+1, 65*8+2, 65*8+3,
  218.             128*8+0, 128*8+1, 128*8+2, 128*8+3, 129*8+0, 129*8+1, 129*8+2, 129*8+3,
  219.             192*8+0, 192*8+1, 192*8+2, 192*8+3, 193*8+0, 193*8+1, 193*8+2, 193*8+3 },
  220.     { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16,
  221.             8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16,
  222.             16*16, 17*16, 18*16, 19*16, 20*16, 21*16, 22*16, 23*16,
  223.             24*16, 25*16, 26*16, 27*16, 28*16, 29*16, 30*16, 31*16 },
  224.     256*8    /* every tile takes 256 consecutive bytes */
  225. };
  226.  
  227.  
  228. static struct GfxDecodeInfo gfxdecodeinfo[] =
  229. {
  230.     { REGION_GFX1, 0, &charlayout,            0, 32 },
  231.     { REGION_GFX2, 0, &tilelayout,         32*4, 16 }, /* Tiles */
  232.     { REGION_GFX3, 0, &spritelayout, 32*4+16*16, 16 }, /* Sprites */
  233.     { -1 } /* end of array */
  234. };
  235.  
  236.  
  237.  
  238. static struct YM2203interface ym2203_interface =
  239. {
  240.     2,            /* 2 chips */
  241.     1500000,    /* 1.5 MHz (?) */
  242.     { YM2203_VOL(14,22), YM2203_VOL(14,22) },
  243.     { 0 },
  244.     { 0 },
  245.     { 0 },
  246.     { 0 }
  247. };
  248.  
  249.  
  250.  
  251. static struct MachineDriver machine_driver_gunsmoke =
  252. {
  253.     /* basic machine hardware */
  254.     {
  255.         {
  256.             CPU_Z80,
  257.             4000000,        /* 4 Mhz (?) */
  258.             readmem,writemem,0,0,
  259.             interrupt,1
  260.         },
  261.         {
  262.             CPU_Z80 | CPU_AUDIO_CPU,
  263.             3000000,    /* 3 Mhz (?) */
  264.             sound_readmem,sound_writemem,0,0,
  265.             interrupt,4
  266.         }
  267.     },
  268.     60, DEFAULT_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  269.     1,    /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
  270.     0,
  271.  
  272.     /* video hardware */
  273.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  274.     gfxdecodeinfo,
  275.     256,32*4+16*16+16*16,
  276.     gunsmoke_vh_convert_color_prom,
  277.  
  278.     VIDEO_TYPE_RASTER,
  279.     0,
  280.     gunsmoke_vh_start,
  281.     gunsmoke_vh_stop,
  282.     gunsmoke_vh_screenrefresh,
  283.  
  284.     /* sound hardware */
  285.     0,0,0,0,
  286.     {
  287.         {
  288.             SOUND_YM2203,
  289.             &ym2203_interface
  290.         }
  291.     }
  292. };
  293.  
  294.  
  295.  
  296. /***************************************************************************
  297.  
  298.   Game driver(s)
  299.  
  300. ***************************************************************************/
  301.  
  302. ROM_START( gunsmoke )
  303.     ROM_REGION( 0x20000, REGION_CPU1 )     /* 2*64k for code */
  304.     ROM_LOAD( "09n_gs03.bin", 0x00000, 0x8000, 0x40a06cef ) /* Code 0000-7fff */
  305.     ROM_LOAD( "10n_gs04.bin", 0x10000, 0x8000, 0x8d4b423f ) /* Paged code */
  306.     ROM_LOAD( "12n_gs05.bin", 0x18000, 0x8000, 0x2b5667fb ) /* Paged code */
  307.  
  308.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  309.     ROM_LOAD( "14h_gs02.bin", 0x00000, 0x8000, 0xcd7a2c38 )
  310.  
  311.     ROM_REGION( 0x04000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  312.     ROM_LOAD( "11f_gs01.bin", 0x00000, 0x4000, 0xb61ece9b ) /* Characters */
  313.  
  314.     ROM_REGION( 0x40000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  315.     ROM_LOAD( "06c_gs13.bin", 0x00000, 0x8000, 0xf6769fc5 ) /* 32x32 tiles planes 2-3 */
  316.     ROM_LOAD( "05c_gs12.bin", 0x08000, 0x8000, 0xd997b78c )
  317.     ROM_LOAD( "04c_gs11.bin", 0x10000, 0x8000, 0x125ba58e )
  318.     ROM_LOAD( "02c_gs10.bin", 0x18000, 0x8000, 0xf469c13c )
  319.     ROM_LOAD( "06a_gs09.bin", 0x20000, 0x8000, 0x539f182d ) /* 32x32 tiles planes 0-1 */
  320.     ROM_LOAD( "05a_gs08.bin", 0x28000, 0x8000, 0xe87e526d )
  321.     ROM_LOAD( "04a_gs07.bin", 0x30000, 0x8000, 0x4382c0d2 )
  322.     ROM_LOAD( "02a_gs06.bin", 0x38000, 0x8000, 0x4cafe7a6 )
  323.  
  324.     ROM_REGION( 0x40000, REGION_GFX3 | REGIONFLAG_DISPOSE )
  325.     ROM_LOAD( "06n_gs22.bin", 0x00000, 0x8000, 0xdc9c508c ) /* Sprites planes 2-3 */
  326.     ROM_LOAD( "04n_gs21.bin", 0x08000, 0x8000, 0x68883749 ) /* Sprites planes 2-3 */
  327.     ROM_LOAD( "03n_gs20.bin", 0x10000, 0x8000, 0x0be932ed ) /* Sprites planes 2-3 */
  328.     ROM_LOAD( "01n_gs19.bin", 0x18000, 0x8000, 0x63072f93 ) /* Sprites planes 2-3 */
  329.     ROM_LOAD( "06l_gs18.bin", 0x20000, 0x8000, 0xf69a3c7c ) /* Sprites planes 0-1 */
  330.     ROM_LOAD( "04l_gs17.bin", 0x28000, 0x8000, 0x4e98562a ) /* Sprites planes 0-1 */
  331.     ROM_LOAD( "03l_gs16.bin", 0x30000, 0x8000, 0x0d99c3b3 ) /* Sprites planes 0-1 */
  332.     ROM_LOAD( "01l_gs15.bin", 0x38000, 0x8000, 0x7f14270e ) /* Sprites planes 0-1 */
  333.  
  334.     ROM_REGION( 0x8000, REGION_GFX4 )    /* background tilemaps */
  335.     ROM_LOAD( "11c_gs14.bin", 0x00000, 0x8000, 0x0af4f7eb )
  336.  
  337.     ROM_REGION( 0x0800, REGION_PROMS )
  338.     ROM_LOAD( "03b_g-01.bin", 0x0000, 0x0100, 0x02f55589 )    /* red component */
  339.     ROM_LOAD( "04b_g-02.bin", 0x0100, 0x0100, 0xe1e36dd9 )    /* green component */
  340.     ROM_LOAD( "05b_g-03.bin", 0x0200, 0x0100, 0x989399c0 )    /* blue component */
  341.     ROM_LOAD( "09d_g-04.bin", 0x0300, 0x0100, 0x906612b5 )    /* char lookup table */
  342.     ROM_LOAD( "14a_g-06.bin", 0x0400, 0x0100, 0x4a9da18b )    /* tile lookup table */
  343.     ROM_LOAD( "15a_g-07.bin", 0x0500, 0x0100, 0xcb9394fc )    /* tile palette bank */
  344.     ROM_LOAD( "09f_g-09.bin", 0x0600, 0x0100, 0x3cee181e )    /* sprite lookup table */
  345.     ROM_LOAD( "08f_g-08.bin", 0x0700, 0x0100, 0xef91cdd2 )    /* sprite palette bank */
  346. ROM_END
  347.  
  348. ROM_START( gunsmrom )
  349.     ROM_REGION( 0x20000, REGION_CPU1 )     /* 2*64k for code */
  350.     ROM_LOAD( "9n_gs03.bin",  0x00000, 0x8000, 0x592f211b ) /* Code 0000-7fff */
  351.     ROM_LOAD( "10n_gs04.bin", 0x10000, 0x8000, 0x8d4b423f ) /* Paged code */
  352.     ROM_LOAD( "12n_gs05.bin", 0x18000, 0x8000, 0x2b5667fb ) /* Paged code */
  353.  
  354.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  355.     ROM_LOAD( "14h_gs02.bin", 0x00000, 0x8000, 0xcd7a2c38 )
  356.  
  357.     ROM_REGION( 0x04000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  358.     ROM_LOAD( "11f_gs01.bin", 0x00000, 0x4000, 0xb61ece9b ) /* Characters */
  359.  
  360.     ROM_REGION( 0x40000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  361.     ROM_LOAD( "06c_gs13.bin", 0x00000, 0x8000, 0xf6769fc5 ) /* 32x32 tiles planes 2-3 */
  362.     ROM_LOAD( "05c_gs12.bin", 0x08000, 0x8000, 0xd997b78c )
  363.     ROM_LOAD( "04c_gs11.bin", 0x10000, 0x8000, 0x125ba58e )
  364.     ROM_LOAD( "02c_gs10.bin", 0x18000, 0x8000, 0xf469c13c )
  365.     ROM_LOAD( "06a_gs09.bin", 0x20000, 0x8000, 0x539f182d ) /* 32x32 tiles planes 0-1 */
  366.     ROM_LOAD( "05a_gs08.bin", 0x28000, 0x8000, 0xe87e526d )
  367.     ROM_LOAD( "04a_gs07.bin", 0x30000, 0x8000, 0x4382c0d2 )
  368.     ROM_LOAD( "02a_gs06.bin", 0x38000, 0x8000, 0x4cafe7a6 )
  369.  
  370.     ROM_REGION( 0x40000, REGION_GFX3 | REGIONFLAG_DISPOSE )
  371.     ROM_LOAD( "06n_gs22.bin", 0x00000, 0x8000, 0xdc9c508c ) /* Sprites planes 2-3 */
  372.     ROM_LOAD( "04n_gs21.bin", 0x08000, 0x8000, 0x68883749 ) /* Sprites planes 2-3 */
  373.     ROM_LOAD( "03n_gs20.bin", 0x10000, 0x8000, 0x0be932ed ) /* Sprites planes 2-3 */
  374.     ROM_LOAD( "01n_gs19.bin", 0x18000, 0x8000, 0x63072f93 ) /* Sprites planes 2-3 */
  375.     ROM_LOAD( "06l_gs18.bin", 0x20000, 0x8000, 0xf69a3c7c ) /* Sprites planes 0-1 */
  376.     ROM_LOAD( "04l_gs17.bin", 0x28000, 0x8000, 0x4e98562a ) /* Sprites planes 0-1 */
  377.     ROM_LOAD( "03l_gs16.bin", 0x30000, 0x8000, 0x0d99c3b3 ) /* Sprites planes 0-1 */
  378.     ROM_LOAD( "01l_gs15.bin", 0x38000, 0x8000, 0x7f14270e ) /* Sprites planes 0-1 */
  379.  
  380.     ROM_REGION( 0x8000, REGION_GFX4 )    /* background tilemaps */
  381.     ROM_LOAD( "11c_gs14.bin", 0x00000, 0x8000, 0x0af4f7eb )
  382.  
  383.     ROM_REGION( 0x0800, REGION_PROMS )
  384.     ROM_LOAD( "03b_g-01.bin", 0x0000, 0x0100, 0x02f55589 )    /* red component */
  385.     ROM_LOAD( "04b_g-02.bin", 0x0100, 0x0100, 0xe1e36dd9 )    /* green component */
  386.     ROM_LOAD( "05b_g-03.bin", 0x0200, 0x0100, 0x989399c0 )    /* blue component */
  387.     ROM_LOAD( "09d_g-04.bin", 0x0300, 0x0100, 0x906612b5 )    /* char lookup table */
  388.     ROM_LOAD( "14a_g-06.bin", 0x0400, 0x0100, 0x4a9da18b )    /* tile lookup table */
  389.     ROM_LOAD( "15a_g-07.bin", 0x0500, 0x0100, 0xcb9394fc )    /* tile palette bank */
  390.     ROM_LOAD( "09f_g-09.bin", 0x0600, 0x0100, 0x3cee181e )    /* sprite lookup table */
  391.     ROM_LOAD( "08f_g-08.bin", 0x0700, 0x0100, 0xef91cdd2 )    /* sprite palette bank */
  392. ROM_END
  393.  
  394. ROM_START( gunsmokj )
  395.     ROM_REGION( 0x20000, REGION_CPU1 )     /* 2*64k for code */
  396.     ROM_LOAD( "gs03_9n.rom",  0x00000, 0x8000, 0xb56b5df6 ) /* Code 0000-7fff */
  397.     ROM_LOAD( "10n_gs04.bin", 0x10000, 0x8000, 0x8d4b423f ) /* Paged code */
  398.     ROM_LOAD( "12n_gs05.bin", 0x18000, 0x8000, 0x2b5667fb ) /* Paged code */
  399.  
  400.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  401.     ROM_LOAD( "14h_gs02.bin", 0x00000, 0x8000, 0xcd7a2c38 )
  402.  
  403.     ROM_REGION( 0x04000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  404.     ROM_LOAD( "11f_gs01.bin", 0x00000, 0x4000, 0xb61ece9b ) /* Characters */
  405.  
  406.     ROM_REGION( 0x40000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  407.     ROM_LOAD( "06c_gs13.bin", 0x00000, 0x8000, 0xf6769fc5 ) /* 32x32 tiles planes 2-3 */
  408.     ROM_LOAD( "05c_gs12.bin", 0x08000, 0x8000, 0xd997b78c )
  409.     ROM_LOAD( "04c_gs11.bin", 0x10000, 0x8000, 0x125ba58e )
  410.     ROM_LOAD( "02c_gs10.bin", 0x18000, 0x8000, 0xf469c13c )
  411.     ROM_LOAD( "06a_gs09.bin", 0x20000, 0x8000, 0x539f182d ) /* 32x32 tiles planes 0-1 */
  412.     ROM_LOAD( "05a_gs08.bin", 0x28000, 0x8000, 0xe87e526d )
  413.     ROM_LOAD( "04a_gs07.bin", 0x30000, 0x8000, 0x4382c0d2 )
  414.     ROM_LOAD( "02a_gs06.bin", 0x38000, 0x8000, 0x4cafe7a6 )
  415.  
  416.     ROM_REGION( 0x40000, REGION_GFX3 | REGIONFLAG_DISPOSE )
  417.     ROM_LOAD( "06n_gs22.bin", 0x00000, 0x8000, 0xdc9c508c ) /* Sprites planes 2-3 */
  418.     ROM_LOAD( "04n_gs21.bin", 0x08000, 0x8000, 0x68883749 ) /* Sprites planes 2-3 */
  419.     ROM_LOAD( "03n_gs20.bin", 0x10000, 0x8000, 0x0be932ed ) /* Sprites planes 2-3 */
  420.     ROM_LOAD( "01n_gs19.bin", 0x18000, 0x8000, 0x63072f93 ) /* Sprites planes 2-3 */
  421.     ROM_LOAD( "06l_gs18.bin", 0x20000, 0x8000, 0xf69a3c7c ) /* Sprites planes 0-1 */
  422.     ROM_LOAD( "04l_gs17.bin", 0x28000, 0x8000, 0x4e98562a ) /* Sprites planes 0-1 */
  423.     ROM_LOAD( "03l_gs16.bin", 0x30000, 0x8000, 0x0d99c3b3 ) /* Sprites planes 0-1 */
  424.     ROM_LOAD( "01l_gs15.bin", 0x38000, 0x8000, 0x7f14270e ) /* Sprites planes 0-1 */
  425.  
  426.     ROM_REGION( 0x8000, REGION_GFX4 )    /* background tilemaps */
  427.     ROM_LOAD( "11c_gs14.bin", 0x00000, 0x8000, 0x0af4f7eb )
  428.  
  429.     ROM_REGION( 0x0800, REGION_PROMS )
  430.     ROM_LOAD( "03b_g-01.bin", 0x0000, 0x0100, 0x02f55589 )    /* red component */
  431.     ROM_LOAD( "04b_g-02.bin", 0x0100, 0x0100, 0xe1e36dd9 )    /* green component */
  432.     ROM_LOAD( "05b_g-03.bin", 0x0200, 0x0100, 0x989399c0 )    /* blue component */
  433.     ROM_LOAD( "09d_g-04.bin", 0x0300, 0x0100, 0x906612b5 )    /* char lookup table */
  434.     ROM_LOAD( "14a_g-06.bin", 0x0400, 0x0100, 0x4a9da18b )    /* tile lookup table */
  435.     ROM_LOAD( "15a_g-07.bin", 0x0500, 0x0100, 0xcb9394fc )    /* tile palette bank */
  436.     ROM_LOAD( "09f_g-09.bin", 0x0600, 0x0100, 0x3cee181e )    /* sprite lookup table */
  437.     ROM_LOAD( "08f_g-08.bin", 0x0700, 0x0100, 0xef91cdd2 )    /* sprite palette bank */
  438. ROM_END
  439.  
  440. ROM_START( gunsmoka )
  441.     ROM_REGION( 0x20000, REGION_CPU1 )     /* 2*64k for code */
  442.     ROM_LOAD( "gs03.9n",      0x00000, 0x8000, 0x51dc3f76 ) /* Code 0000-7fff */
  443.     ROM_LOAD( "gs04.10n",     0x10000, 0x8000, 0x5ecf31b8 ) /* Paged code */
  444.     ROM_LOAD( "gs05.12n",     0x18000, 0x8000, 0x1c9aca13 ) /* Paged code */
  445.  
  446.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  447.     ROM_LOAD( "14h_gs02.bin", 0x00000, 0x8000, 0xcd7a2c38 )
  448.  
  449.     ROM_REGION( 0x04000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  450.     ROM_LOAD( "11f_gs01.bin", 0x00000, 0x4000, 0xb61ece9b ) /* Characters */
  451.  
  452.     ROM_REGION( 0x40000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  453.     ROM_LOAD( "06c_gs13.bin", 0x00000, 0x8000, 0xf6769fc5 ) /* 32x32 tiles planes 2-3 */
  454.     ROM_LOAD( "05c_gs12.bin", 0x08000, 0x8000, 0xd997b78c )
  455.     ROM_LOAD( "04c_gs11.bin", 0x10000, 0x8000, 0x125ba58e )
  456.     ROM_LOAD( "02c_gs10.bin", 0x18000, 0x8000, 0xf469c13c )
  457.     ROM_LOAD( "06a_gs09.bin", 0x20000, 0x8000, 0x539f182d ) /* 32x32 tiles planes 0-1 */
  458.     ROM_LOAD( "05a_gs08.bin", 0x28000, 0x8000, 0xe87e526d )
  459.     ROM_LOAD( "04a_gs07.bin", 0x30000, 0x8000, 0x4382c0d2 )
  460.     ROM_LOAD( "02a_gs06.bin", 0x38000, 0x8000, 0x4cafe7a6 )
  461.  
  462.     ROM_REGION( 0x40000, REGION_GFX3 | REGIONFLAG_DISPOSE )
  463.     ROM_LOAD( "06n_gs22.bin", 0x00000, 0x8000, 0xdc9c508c ) /* Sprites planes 2-3 */
  464.     ROM_LOAD( "04n_gs21.bin", 0x08000, 0x8000, 0x68883749 ) /* Sprites planes 2-3 */
  465.     ROM_LOAD( "03n_gs20.bin", 0x10000, 0x8000, 0x0be932ed ) /* Sprites planes 2-3 */
  466.     ROM_LOAD( "01n_gs19.bin", 0x18000, 0x8000, 0x63072f93 ) /* Sprites planes 2-3 */
  467.     ROM_LOAD( "06l_gs18.bin", 0x20000, 0x8000, 0xf69a3c7c ) /* Sprites planes 0-1 */
  468.     ROM_LOAD( "04l_gs17.bin", 0x28000, 0x8000, 0x4e98562a ) /* Sprites planes 0-1 */
  469.     ROM_LOAD( "03l_gs16.bin", 0x30000, 0x8000, 0x0d99c3b3 ) /* Sprites planes 0-1 */
  470.     ROM_LOAD( "01l_gs15.bin", 0x38000, 0x8000, 0x7f14270e ) /* Sprites planes 0-1 */
  471.  
  472.     ROM_REGION( 0x8000, REGION_GFX4 )    /* background tilemaps */
  473.     ROM_LOAD( "11c_gs14.bin", 0x00000, 0x8000, 0x0af4f7eb )
  474.  
  475.     ROM_REGION( 0x0800, REGION_PROMS )
  476.     ROM_LOAD( "03b_g-01.bin", 0x0000, 0x0100, 0x02f55589 )    /* red component */
  477.     ROM_LOAD( "04b_g-02.bin", 0x0100, 0x0100, 0xe1e36dd9 )    /* green component */
  478.     ROM_LOAD( "05b_g-03.bin", 0x0200, 0x0100, 0x989399c0 )    /* blue component */
  479.     ROM_LOAD( "09d_g-04.bin", 0x0300, 0x0100, 0x906612b5 )    /* char lookup table */
  480.     ROM_LOAD( "14a_g-06.bin", 0x0400, 0x0100, 0x4a9da18b )    /* tile lookup table */
  481.     ROM_LOAD( "15a_g-07.bin", 0x0500, 0x0100, 0xcb9394fc )    /* tile palette bank */
  482.     ROM_LOAD( "09f_g-09.bin", 0x0600, 0x0100, 0x3cee181e )    /* sprite lookup table */
  483.     ROM_LOAD( "08f_g-08.bin", 0x0700, 0x0100, 0xef91cdd2 )    /* sprite palette bank */
  484. ROM_END
  485.  
  486.  
  487.  
  488. /*
  489.   All the sets are almost identical apart from gunsmoka which is quite
  490.   different: the levels are in a different order, and the "Demonstration" dip
  491.   switch has no effect.
  492.  */
  493. GAMEX( 1985, gunsmoke, 0,        gunsmoke, gunsmoke, 0, ROT270, "Capcom", "Gun.Smoke (World)", GAME_NO_COCKTAIL )
  494. GAMEX( 1985, gunsmrom, gunsmoke, gunsmoke, gunsmoke, 0, ROT270, "Capcom (Romstar license)", "Gun.Smoke (US set 1)", GAME_NO_COCKTAIL )
  495. GAMEX( 1986, gunsmoka, gunsmoke, gunsmoke, gunsmoke, 0, ROT270, "Capcom", "Gun.Smoke (US set 2)", GAME_NO_COCKTAIL )
  496. GAMEX( 1985, gunsmokj, gunsmoke, gunsmoke, gunsmoke, 0, ROT270, "Capcom", "Gun.Smoke (Japan)", GAME_NO_COCKTAIL )
  497.